import sys

from PyQt6.QtWidgets import QApplication, QTextEdit, QLabel, QLineEdit
from PyQt6 import uic

if __name__ == '__main__':
    # #加载UI界面并显示，方法一
    app = QApplication(sys.argv)
    ui = uic.loadUi('./UI/myFrm1.ui')
    ui.show()
    # #------------------------------------------------------

    # 加载UI界面并显示，方法二
    # app = QApplication(sys.argv)
    # w = QMainWindow()
    # ui = UI.myFrm1.Ui_MainWindow()
    # ui.setupUi(w)
    # w.show()
    # ------------------------------------------------------

    l1: QLabel = ui.lbl2
    l2: QLabel = ui.lbl2
    l1.setText('name：')
    l2.setText('pin')
    edit1: QTextEdit = ui.lineEdit
    edit2: QTextEdit = ui.lineEdit_2
    #edit1.setText(edit2.text())
    #edit2.setText('请输入密码...')
    edit2.setEchoMode(QLineEdit.EchoMode.Password)
    #------------------------------------------------------
    txtEdit1: QTextEdit = ui.textEdit
    txtEdit2: QTextEdit = ui.textEdit_2
    txtEdit1.setPlainText('asdfasdfasdfasdfasdfasdf')
    txtEdit2.setHtml("study python to <a href='http://www.baidu.com'>baidu</a>")

    # #------------------------------------------------------
    # 保持运行，直到程序关闭
    sys.exit(app.exec())

